﻿using INTEX.DataBase.Tools;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;

namespace WPFExcelReport
{
    public partial class VICC_MKRF
    {
        public void SetUpNewRow(ref DataRow dwReturn)
        {

            switch (app.company)
            {
                case "YGR":
                case "YCC":
                default:
                    #region=========
                    dwReturn["ABAID"] = "WD54925";
                    dwReturn["MACHINEID"] = "m_0600_01";
                    dwReturn["ABKKDAUFTNR"] = "                    ";
                    dwReturn["ABPART"] = "ÎÂ¶ÈÇÐ»»";
                    dwReturn["ABPVAR"] = "   ";
                    dwReturn["ABPFARBE"] = "1143      ";
                    dwReturn["JW"] = "  ";
                    dwReturn["ABFMANDANT"] = "00";
                    dwReturn["ABFAUFKRS"] = "WD";
                    dwReturn["ABFAUFLFD"] = "201601";
                    dwReturn["ABFAUFPOS"] = "026";
                    dwReturn["MKFTP"] = "0000";
                    dwReturn["ABFBASMGE"] = "500000";
                    dwReturn["ABFME"] = "5";
                    dwReturn["ABFAFOLGE"] = "020";
                    dwReturn["ABFPLANKZ"] = "J";
                    dwReturn["ABFKSTKRS"] = "  ";
                    dwReturn["ABFKST"] = "0600";
                    dwReturn["ABFAGANG"] = "RS             ";
                    dwReturn["ABFMTYP"] = "DXJ     ";
                    dwReturn["ABFMNRKRS"] = "  ";
                    dwReturn["ABFMLFDNR"] = "0000";
                    dwReturn["ABFMPOS"] = "00";
                    dwReturn["ABFAMASCHZT"] = "10";
                    dwReturn["ABFSOLLMG"] = "800000";
                    dwReturn["ABFSOLLME"] = "5";
                    dwReturn["ABFFIX"] = "N";
                    dwReturn["ABFSTATUS"] = " ";
                    dwReturn["ABFSOLLSTART"] = "20160217";
                    dwReturn["ABFSOLLDAT"] = "20160217";
                    dwReturn["ABFBNRKRS"] = "  ";
                    dwReturn["ABFBLFDNR"] = "0600";
                    dwReturn["ABFBPOS"] = "01";
                    dwReturn["ABFIMNRKRS"] = "  ";
                    dwReturn["ABFIMLFDNR"] = "0600";
                    dwReturn["ABFIMPOS"] = "03";
                    dwReturn["ABFIMG"] = "0";
                    dwReturn["ABFISTARTDAT"] = "0";
                    dwReturn["ABFISTARTZT"] = "0";
                    dwReturn["ABFIENDDAT"] = "0";
                    dwReturn["ABFIENDZT"] = "0";
                    dwReturn["SPCONFIRM"] = "        ";
                    dwReturn["MKFPLDATV"] = "20160126";
                    dwReturn["MKFPLTIME"] = "2059";
                    dwReturn["MKFSCHICHTV"] = "";
                    dwReturn["ABFMASCHZE"] = "  ";
                    dwReturn["MKFSORTFD"] = "                                                      ";
                    dwReturn["MKFLFDNR"] = "0";
                    dwReturn["MKFERLKZ"] = " ";
                    dwReturn["MKFERLDAT"] = "0";
                    dwReturn["MKFSME"] = "5";
                    dwReturn["MKFSMG1"] = "0";
                    dwReturn["MKFSMG2"] = "0";
                    dwReturn["MKFSMG3"] = "0";
                    dwReturn["MKFSMG4"] = "0";
                    dwReturn["MKFSMG5"] = "80000";
                    dwReturn["MKFSMG6"] = "0";
                    dwReturn["MKFSMG7"] = "0";
                    dwReturn["MKFSMG8"] = "0";
                    dwReturn["PSTARTTIME"] = "0";
                    dwReturn["PENDTIME"] = "0";
                    dwReturn["ABFMASCHZT"] = "100";
                    dwReturn["JP01"] = "0";
                    dwReturn["JP02"] = "1";
                    dwReturn["JP03"] = "0";
                    dwReturn["JP04"] = "0";
                    dwReturn["JP05"] = "0";
                    dwReturn["JP06"] = "0";
                    dwReturn["JP07"] = "0";
                    dwReturn["JP08"] = "0";
                    dwReturn["JP09"] = "0";
                    dwReturn["JP10"] = "0";
                    dwReturn["JP11"] = "0";
                    dwReturn["JP12"] = "0";
                    dwReturn["JP13"] = "0";
                    dwReturn["JP14"] = "0";
                    dwReturn["JP15"] = "0";
                    dwReturn["JP16"] = "0";
                    dwReturn["JP17"] = "0";
                    dwReturn["JP18"] = "0";
                    dwReturn["JP19"] = "0";
                    dwReturn["JP20"] = "0";
                    dwReturn["JP21"] = "0";
                    dwReturn["JP22"] = "0";
                    dwReturn["JP23"] = "0";
                    dwReturn["JP24"] = "0";
                    dwReturn["JP25"] = "0";
                    dwReturn["JP26"] = "0";
                    dwReturn["JP27"] = "0";
                    dwReturn["JP28"] = "0";
                    dwReturn["JP29"] = "0";
                    dwReturn["JP30"] = "0";
                    dwReturn["JP31"] = "0";
                    dwReturn["JP32"] = "0";
                    dwReturn["JP33"] = "0";
                    dwReturn["JP34"] = "0";
                    dwReturn["JP35"] = "0";
                    dwReturn["JP36"] = "0";
                    dwReturn["JP37"] = "0";
                    dwReturn["JP38"] = "0";
                    dwReturn["JP39"] = "0";
                    dwReturn["JP41"] = "0";
                    dwReturn["JP42"] = "0";
                    dwReturn["JP43"] = "0";
                    dwReturn["JP44"] = "0";
                    dwReturn["JP45"] = "0";
                    dwReturn["JP46"] = "0";
                    dwReturn["JP47"] = "0";
                    dwReturn["JP48"] = "0";
                    dwReturn["JP49"] = "0";
                    dwReturn["JP50"] = "0";
                    dwReturn["ENDATE"] = "20140101";
                    dwReturn["ENDTIME"] = "0";
                    dwReturn["JOBTYPE"] = "W";
                    dwReturn["CR"] = "0";
                    dwReturn["CG"] = "0";
                    dwReturn["CB"] = "0";
                    dwReturn["RGB"] = "0";
                    dwReturn["CGROUP"] = "0";
                    dwReturn["ABPDESS"] = "          ";
                    dwReturn["ABPCOLORIT"] = "          ";
                    dwReturn["ABPBESCHICH"] = "          ";
                    dwReturn["ABPGROE"] = "       ";
                    dwReturn["ABPWAKZ"] = "";
                    dwReturn["BLOCKEDID"] = "";
                    dwReturn["MATREADYDATE"] = "0";
                    dwReturn["MATREADYTIME"] = "0";
                    dwReturn["MATBLOCKID"] = "";
                    dwReturn["TPAUTO"] = "0";
                    dwReturn["POSTYP"] = "   ";
                    dwReturn["ABPTYPE"] = "GP";
                    dwReturn["SFILETME"] = "0";
                    dwReturn["EFILETME"] = "0"; 
                    #endregion
                    break;
            }
        }

      
        public void InsertICC_MKRF(DataRow dwData, int option = 1)
        { 
          
            switch (option)
            {
                case 0: INTMKRF00(dwData); break;
                case 1: INTMKRF01(dwData); break;
                case 2: INTMKRF02(dwData); break;
                case 3: INTMKRF03(dwData); break; 
                case 4: INTMKRF04(dwData); break;//将所有的生产单做为任务插入 
                case 5: INTMKRF05(dwData); break;//将所有的销售单做为任务插入 
                case 6: INTMKRF06(dwData); break; 
            }
           
        }
        public void INTMKRF00(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "INSERT INTO ICC_MKRF ( ABAID,MACHINEID,ABKKDAUFTNR,ABPART,ABPVAR,ABPFARBE,JW,ABFMANDANT,ABFAUFKRS,ABFAUFLFD,ABFAUFPOS,MKFTP,ABFBASMGE,ABFME,ABFAFOLGE,ABFPLANKZ,ABFKSTKRS,ABFKST,ABFAGANG,ABFMTYP,ABFMNRKRS,ABFMLFDNR,ABFMPOS,ABFAMASCHZT,ABFSOLLMG,ABFSOLLME,ABFFIX,ABFSTATUS,ABFSOLLSTART,ABFSOLLDAT,ABFBNRKRS,ABFBLFDNR,ABFBPOS,ABFIMNRKRS,ABFIMLFDNR,ABFIMPOS,ABFIMG,ABFISTARTDAT,ABFISTARTZT,ABFIENDDAT,ABFIENDZT,SPCONFIRM,MKFPLDATV,MKFPLTIME,MKFSCHICHTV,ABFMASCHZE,MKFSORTFD,MKFLFDNR,MKFERLKZ,MKFERLDAT,MKFSME,MKFSMG1,MKFSMG2,MKFSMG3,MKFSMG4,MKFSMG5,MKFSMG6,MKFSMG7,MKFSMG8,PSTARTTIME,PENDTIME,ABFMASCHZT,JP01,JP02,JP03,JP04,JP05,JP06,JP07,JP08,JP09,JP10,JP11,JP12,JP13,JP14,JP15,JP16,JP17,JP18,JP19,JP20,JP21,JP22,JP23,JP24,JP25,JP26,JP27,JP28,JP29,JP30,JP31,JP32,JP33,JP34,JP35,JP36,JP37,JP38,JP39,JP41,JP42,JP43,JP44,JP45,JP46,JP47,JP48,JP49,JP50,ENDATE,ENDTIME,JOBTYPE,CR,CG,CB,RGB,CGROUP,ABPDESS,ABPCOLORIT,ABPBESCHICH,ABPGROE,ABPWAKZ,BLOCKEDID,MATREADYDATE,MATREADYTIME,MATBLOCKID,TPAUTO,POSTYP,ABPTYPE,SFILETME,EFILETME)"
           + " VALUES (:ABAID:,:MACHINEID:,:ABKKDAUFTNR:,:ABPART:,:ABPVAR:,:ABPFARBE:,:JW:,:ABFMANDANT:,:ABFAUFKRS:,:ABFAUFLFD:,:ABFAUFPOS:,:MKFTP:,:ABFBASMGE:,:ABFME:,:ABFAFOLGE:,:ABFPLANKZ:,:ABFKSTKRS:,:ABFKST:,:ABFAGANG:,:ABFMTYP:,:ABFMNRKRS:,:ABFMLFDNR:,:ABFMPOS:,:ABFAMASCHZT:,:ABFSOLLMG:,:ABFSOLLME:,:ABFFIX:,:ABFSTATUS:,:ABFSOLLSTART:,:ABFSOLLDAT:,:ABFBNRKRS:,:ABFBLFDNR:,:ABFBPOS:,:ABFIMNRKRS:,:ABFIMLFDNR:,:ABFIMPOS:,:ABFIMG:,:ABFISTARTDAT:,:ABFISTARTZT:,:ABFIENDDAT:,:ABFIENDZT:,:SPCONFIRM:,:MKFPLDATV:,:MKFPLTIME:,:MKFSCHICHTV:,:ABFMASCHZE:,:MKFSORTFD:,:MKFLFDNR:,:MKFERLKZ:,:MKFERLDAT:,:MKFSME:,:MKFSMG1:,:MKFSMG2:,:MKFSMG3:,:MKFSMG4:,:MKFSMG5:,:MKFSMG6:,:MKFSMG7:,:MKFSMG8:,:PSTARTTIME:,:PENDTIME:,:ABFMASCHZT:,:JP01:,:JP02:,:JP03:,:JP04:,:JP05:,:JP06:,:JP07:,:JP08:,:JP09:,:JP10:,:JP11:,:JP12:,:JP13:,:JP14:,:JP15:,:JP16:,:JP17:,:JP18:,:JP19:,:JP20:,:JP21:,:JP22:,:JP23:,:JP24:,:JP25:,:JP26:,:JP27:,:JP28:,:JP29:,:JP30:,:JP31:,:JP32:,:JP33:,:JP34:,:JP35:,:JP36:,:JP37:,:JP38:,:JP39:,:JP41:,:JP42:,:JP43:,:JP44:,:JP45:,:JP46:,:JP47:,:JP48:,:JP49:,:JP50:,:ENDATE:,:ENDTIME:,:JOBTYPE:,:CR:,:CG:,:CB:,:RGB:,:CGROUP:,:ABPDESS:,:ABPCOLORIT:,:ABPBESCHICH:,:ABPGROE:,:ABPWAKZ:,:BLOCKEDID:,:MATREADYDATE:,:MATREADYTIME:,:MATBLOCKID:,:TPAUTO:,:POSTYP:,:ABPTYPE:,:SFILETME:,:EFILETME:)";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
            Connect2Proxy(or1);
        }
        public void INTMKRF01(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "INSERT INTO ICC_MKRF (ABAID,JP05,JP50,JP06,JP07,ABKKDAUFTNR, ABPART, ABPVAR, ABPFARBE, JW, ABFMANDANT, ABFAUFKRS, ABFAUFLFD, ABFAUFPOS, MKFTP, ABFBASMGE,ABFME,ABFAFOLGE, ABFPLANKZ, ABFKSTKRS, ABFKST, ABFAGANG, ABFMTYP, ABFMNRKRS, ABFMLFDNR, ABFMPOS,ABFAMASCHZT, ABFSOLLMG, ABFSOLLME, ABFFIX, ABFSTATUS, ABFSOLLSTART, ABFSOLLDAT, ABFBNRKRS, ABFBLFDNR, ABFBPOS, ABFIMNRKRS, ABFIMLFDNR, ABFIMPOS, ABFIMG, ABFISTARTDAT, ABFISTARTZT, ABFIENDDAT, ABFIENDZT, SPCONFIRM, MKFPLDATV, MKFPLTIME, MKFSCHICHTV, ABFMASCHZE, MKFSORTFD, MKFLFDNR, MKFERLKZ, MKFERLDAT, MKFSME, MKFSMG1, MKFSMG2, MKFSMG3, MKFSMG4, MKFSMG5, MKFSMG6, MKFSMG7, MKFSMG8, PSTARTTIME, PENDTIME, ABFMASCHZT)"
                    + " SELECT SEQ_ICC_ITX.NEXTVAL AS ABAID,0,0, ABPPOSTYP, ABPAUFART, ABKKDAUFTNR,ABPART,ABPVAR,ABPFARBE,' ' AS JW,ABFMANDANT,ABFAUFKRS,ABFAUFLFD,ABFAUFPOS,'0000' AS MKFTP,ABFBASMGE,ABFME,ABFAFOLGE,ABFPLANKZ,ABFKSTKRS,ABFKST,ABFAGANG, ABFMTYP,ABFMNRKRS,ABFMLFDNR,ABFMPOS,ABFAMASCHZT,ABFSOLLMG,ABFSOLLME,ABFFIX,ABFSTATUS,ABFSOLLSTART,ABFSOLLDAT,NVL(MKFMNRKRS,' ') AS ABFBNRKRS,NVL(MKFMLFDNR,'0000') AS ABFBLFDNR,NVL(MKFMPOS,'00') AS ABFBPOS,ABFIMNRKRS,ABFIMLFDNR,ABFIMPOS,ABFIMG,ABFISTARTDAT,ABFISTARTZT,ABFIENDDAT,ABFIENDZT,' ' AS SPCONFIRM,NVL(MKFPLDATV,0) AS MKFPLDATV,0 as MKFPLTIME,MKFSCHICHTV,ABFMASCHZE,' ' AS MKFSORTFD,MKFLFDNR, NVL(MKFERLKZ,' '),ABFIENDDAT AS MKFERLDAT,MKFSME,MKFSMG1,MKFSMG2,MKFSMG3,MKFSMG4,MKFSMG5,MKFSMG6,MKFSMG7,MKFSMG8,0 AS PSTARTTIME,0 AS PENDTIME,ABFMASCHZT FROM ABFOLGE F JOIN ABPOS P ON ABFSTATUS =' 'AND ABFAGANG=:ABFAGANG: AND ABFMANDANT=ABPMANDANT AND ABFAUFKRS=ABPAUFKRS AND ABFAUFLFD=ABPAUFLFD AND ABFAUFPOS=ABPAUFPOS JOIN ABKOPF ON ABKMANDANT=ABPMANDANT AND ABKAUFKRS=ABPAUFKRS AND ABKAUFLFD=ABPAUFLFD LEFT JOIN MKRF S ON MKFMANDANT=ABFMANDANT AND ABFAUFKRS=MKFAUFKRS AND ABFAUFLFD=MKFAUFLFD AND ABFAUFPOS=MKFAUFPOS AND ABFAFOLGE=MKFAFOLGE "
            +" WHERE ABFMANDANT=:ABFMANDANT: AND ABFKSTKRS=:ABFKSTKRS: AND ABFKST=:ABFKST: and ABFFIX='J' AND NOT EXISTS ( SELECT 1 FROM ICC_MKRF X WHERE X.ABFMANDANT=F.ABFMANDANT AND X.ABFAUFKRS=F.ABFAUFKRS AND X.ABFAUFLFD=F.ABFAUFLFD AND X.ABFAUFPOS=F.ABFAUFPOS AND X.ABFAFOLGE=F.ABFAFOLGE AND MKFTP='0000')";
           
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void INTMKRF02(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "INSERT INTO ICC_MKRF (ABAID,JP05,JP50,JP06,JP07, ABKKDAUFTNR, ABPART, ABPVAR, ABPFARBE, JW, ABFMANDANT, ABFAUFKRS, ABFAUFLFD, ABFAUFPOS, MKFTP, ABFBASMGE,ABFME,ABFAFOLGE, ABFPLANKZ, ABFKSTKRS, ABFKST, ABFAGANG, ABFMTYP, ABFMNRKRS, ABFMLFDNR, ABFMPOS,ABFAMASCHZT, ABFSOLLMG, ABFSOLLME, ABFFIX, ABFSTATUS, ABFSOLLSTART, ABFSOLLDAT, ABFBNRKRS, ABFBLFDNR, ABFBPOS, ABFIMNRKRS, ABFIMLFDNR, ABFIMPOS, ABFIMG, ABFISTARTDAT, ABFISTARTZT, ABFIENDDAT, ABFIENDZT, SPCONFIRM, MKFPLDATV, MKFPLTIME, MKFSCHICHTV, ABFMASCHZE, MKFSORTFD, MKFLFDNR, MKFERLKZ, MKFERLDAT, MKFSME, MKFSMG1, MKFSMG2, MKFSMG3, MKFSMG4, MKFSMG5, MKFSMG6, MKFSMG7, MKFSMG8, PSTARTTIME, PENDTIME, ABFMASCHZT)"
                 + " SELECT SEQ_ICC_ITX.NEXTVAL AS ABAID,0,0,ABPPOSTYP, ABPAUFART, ABKKDAUFTNR,ABPART,ABPVAR,ABPFARBE,' ' AS JW,ABFMANDANT,ABFAUFKRS,ABFAUFLFD,ABFAUFPOS,'0000' AS MKFTP,ABFBASMGE,ABFME,ABFAFOLGE,ABFPLANKZ,ABFKSTKRS,ABFKST,ABFAGANG, ABFMTYP,ABFMNRKRS,ABFMLFDNR,ABFMPOS,ABFAMASCHZT,ABFSOLLMG,ABFSOLLME,ABFFIX,ABFSTATUS,ABFSOLLSTART,ABFSOLLDAT,NVL(MKFMNRKRS,' ') AS ABFBNRKRS,NVL(MKFMLFDNR,'0000') AS ABFBLFDNR,NVL(MKFMPOS,'00') AS ABFBPOS,ABFIMNRKRS,ABFIMLFDNR,ABFIMPOS,ABFIMG,ABFISTARTDAT,ABFISTARTZT,ABFIENDDAT,ABFIENDZT,' ' AS SPCONFIRM,NVL(MKFPLDATV,0) AS MKFPLDATV,0 as MKFPLTIME,MKFSCHICHTV,ABFMASCHZE,' ' AS MKFSORTFD,MKFLFDNR, NVL(MKFERLKZ,' '),ABFIENDDAT AS MKFERLDAT,MKFSME,MKFSMG1,MKFSMG2,MKFSMG3,MKFSMG4,MKFSMG5,MKFSMG6,MKFSMG7,MKFSMG8,0 AS PSTARTTIME,0 AS PENDTIME,ABFMASCHZT FROM ABFOLGE F JOIN ABPOS P ON ABFSTATUS =' 'AND ABFAGANG=:ABFAGANG: AND ABFMANDANT=ABPMANDANT AND ABFAUFKRS=ABPAUFKRS AND ABFAUFLFD=ABPAUFLFD AND ABFAUFPOS=ABPAUFPOS JOIN ABKOPF ON ABKMANDANT=ABPMANDANT AND ABKAUFKRS=ABPAUFKRS AND ABKAUFLFD=ABPAUFLFD LEFT JOIN MKRF S ON MKFMANDANT=ABFMANDANT AND ABFAUFKRS=MKFAUFKRS AND ABFAUFLFD=MKFAUFLFD AND ABFAUFPOS=MKFAUFPOS AND ABFAFOLGE=MKFAFOLGE WHERE"
            +" ABFMANDANT=:ABFMANDANT: AND ABFKSTKRS=:ABFKSTKRS: AND ABFKST=:ABFKST: AND NOT EXISTS ( SELECT 1 FROM ICC_MKRF X WHERE X.ABFMANDANT=F.ABFMANDANT AND X.ABFAUFKRS=F.ABFAUFKRS AND X.ABFAUFLFD=F.ABFAUFLFD AND X.ABFAUFPOS=F.ABFAUFPOS AND X.ABFAFOLGE=F.ABFAFOLGE AND MKFTP='0000')";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void INTMKRF03(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "INSERT INTO ICC_MKRF (ABAID) VALUES( :ABAID)";
            or1.Parameters.Add("ABAID", OracleType.NVarChar).Value = dwData["ABAID"].ToString();
            Connect2Proxy(or1);
        }
        public void INTMKRF04(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "INSERT INTO ICC_MKRF (ABAID,JOBTYPE,JP06,JP07,ABKKDAUFTNR, ABPART, ABPVAR, ABPFARBE, JW, ABFMANDANT, ABFAUFKRS, ABFAUFLFD, ABFAUFPOS, MKFTP, ABFBASMGE,ABFME,ABFAFOLGE, ABFPLANKZ, ABFKSTKRS, ABFKST, ABFAGANG, ABFMTYP, ABFMNRKRS, ABFMLFDNR, ABFMPOS,ABFAMASCHZT, ABFSOLLMG, ABFSOLLME, ABFFIX, ABFSTATUS, ABFSOLLSTART, ABFSOLLDAT, ABFBNRKRS, ABFBLFDNR, ABFBPOS, ABFIMNRKRS, ABFIMLFDNR, ABFIMPOS, ABFIMG, ABFISTARTDAT, ABFISTARTZT, ABFIENDDAT, ABFIENDZT, SPCONFIRM, MKFPLDATV, MKFPLTIME, MKFSCHICHTV, ABFMASCHZE, MKFSORTFD, MKFLFDNR, MKFERLKZ, MKFERLDAT, MKFSME, MKFSMG1, MKFSMG2, MKFSMG3, MKFSMG4, MKFSMG5, MKFSMG6, MKFSMG7, MKFSMG8, PSTARTTIME, PENDTIME, ABFMASCHZT)"
                + " SELECT SEQ_ICC_ITX.NEXTVAL AS ABAID, 'W' AS JOBTYPE, ABPPOSTYP, ABPAUFART, ABKKDAUFTNR, ABPART, ABPVAR, ABPFARBE, ' ' AS JW, ABFMANDANT, ABFAUFKRS, ABFAUFLFD, ABFAUFPOS, '0000' AS MKFTP, ABFBASMGE, ABFME, '000' AS ABFAFOLGE, ABFPLANKZ, '99' AS ABFKSTKRS, '9999' AS ABFKST, '999 ' AS ABFAGANG, '99999999' AS ABFMTYP, '99' AS ABFMNRKRS, '9999' AS ABFMLFDNR, ABFMPOS, ABFAMASCHZT, ABFSOLLMG, ABFSOLLME, 'J' AS ABFFIX, ABFSTATUS, ABFSOLLSTART, ABFSOLLDAT, NVL(MKFMNRKRS, ' ') AS ABFBNRKRS, NVL(MKFMLFDNR, '0000') AS ABFBLFDNR, NVL(MKFMPOS, '00') AS ABFBPOS, ABFIMNRKRS, ABFIMLFDNR, ABFIMPOS, ABFIMG, ABFISTARTDAT, ABFISTARTZT, ABFIENDDAT, ABFIENDZT, ' ' AS SPCONFIRM, NVL(ABPSTARTDAT, 0) AS MKFPLDATV, 0 as MKFPLTIME, MKFSCHICHTV, ABFMASCHZE, ' ' AS MKFSORTFD, MKFLFDNR, ABPERLKZ AS MKFERLKZ, ABPERLDAT AS MKFERLDAT, MKFSME, ABPSOLLMENGE1 AS MKFSMG1, ABPSOLLMENGE2 AS MKFSMG2, ABPSOLLMENGE3 AS MKFSMG3, ABPSOLLMENGE4 AS MKFSMG4, ABPSOLLMENGE5 AS MKFSMG5, ABPSOLLMENGE6 AS MKFSMG6, ABPSOLLMENGE7 AS MKFSMG7, ABPSOLLMENGE8 AS MKFSMG8, ABPSTARTDAT AS PSTARTTIME, ABPENDDAT AS PENDTIME, ABFMASCHZT FROM ABFOLGE F JOIN ABPOS P ON ABFAFOLGE = '010' AND ABFMANDANT = ABPMANDANT AND ABFAUFKRS = ABPAUFKRS AND ABFAUFLFD = ABPAUFLFD AND ABFAUFPOS = ABPAUFPOS JOIN ABKOPF ON ABKMANDANT = ABPMANDANT AND ABKAUFKRS = ABPAUFKRS AND ABKAUFLFD = ABPAUFLFD LEFT JOIN MKRF S ON MKFMANDANT = ABFMANDANT AND ABFAUFKRS = MKFAUFKRS AND ABFAUFLFD = MKFAUFLFD AND ABFAUFPOS = MKFAUFPOS AND ABFAFOLGE = MKFAFOLGE WHERE ABFMANDANT = '00' AND NOT EXISTS (SELECT 1 FROM ICC_MKRF X WHERE X.ABFMANDANT = F.ABFMANDANT AND X.ABFAUFKRS = F.ABFAUFKRS AND X.ABFAUFLFD = F.ABFAUFLFD AND X.ABFAUFPOS = F.ABFAUFPOS AND X.ABFAFOLGE = '000' AND MKFTP = '0000')";
             Connect2Proxy(or1);
        }
        public void INTMKRF05(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "INSERT INTO ICC_MKRF (ABAID,JOBTYPE,JP06,JP07,ABKKDAUFTNR, ABPART, ABPVAR, ABPFARBE, ABFMANDANT, ABFAUFKRS, ABFAUFLFD, ABFAUFPOS, MKFTP,ABFBASMGE,ABFAFOLGE, ABFKSTKRS, ABFKST, ABFAGANG, ABFMTYP, ABFMNRKRS, ABFMLFDNR, ABFMPOS, MKFPLDATV,ENDATE,ABFSOLLSTART, ABFSOLLDAT,ABFBNRKRS, ABFBLFDNR, ABFBPOS, ABFIMNRKRS, ABFIMLFDNR, ABFIMPOS, MKFERLKZ, MKFERLDAT, PSTARTTIME, PENDTIME)"
                   + " SELECT SEQ_ICC_ITX.NEXTVAL AS ABAID, 'W' AS JOBTYPE, VKPPOSTYP,'VK' AS ABPAUFART, VKKAUFKRS||'-'||SUBSTR(VKKAUFLFD,-4) AS ABKKDAUFTNR, VAFPART AS ABPART, VAFPVAR AS ABPVAR, VAFFFARBE AS ABPFARBE,VKPMANDANT AS ABFMANDANT,VKPAUFKRS AS ABFAUFKRS, VKPAUFLFD AS ABFAUFLFD, VKPAUFPOS AS ABFAUFPOS,'0000' AS MKFTP,ROUND(VKPMENGE1*VKPMEEHFKT*0.001*0.001*0.01*1000) AS ABFBASMGE,'000' AS ABFAFOLGE,'99' AS ABFKSTKRS,'9999' AS ABFKST,'999 ' AS ABFAGANG, '99999999' AS ABFMTYP,'99' AS ABFMNRKRS,'9999' AS ABFMLFDNR, '00' AS ABFMPOS, VKPNEUDAT AS MKFPLDATV, VKPLIEFTERM AS ENDDATE, VKPNEUDAT AS ABFSOLLSTART, VKPNEUDAT AS ABFSOLLDAT,'99' AS ABFBNRKRS, '9999' AS ABFBLFDNR, '00' AS ABFBPOS, '99' AS ABFIMNRKRS, '9999' AS ABFIMLFDNR, '00' AS ABFIMPOS,VKPERL AS MKFERLKZ,VKPERLDAT AS MKFERLDAT, VKPNEUDAT AS PSTARTTIME,VKPERLDAT AS PENDTIME FROM VKPOS P JOIN VAFARBEN M ON VKPSA = ' ' AND VKPKOLL=VAFKOLL AND VKPART=VAFART AND VKPFARBE=VAFFARBE JOIN VKKOPF ON VKKSA=' ' AND VKKMANDANT = VKPMANDANT AND VKKAUFKRS = VKPAUFKRS AND VKKAUFLFD = VKPAUFLFD WHERE VKPSA=' ' AND VKPMANDANT = '00' AND NOT EXISTS (SELECT 1 FROM ICC_MKRF X WHERE X.ABFMANDANT = P.VKPMANDANT AND X.ABFAUFKRS = P.VKPAUFKRS AND X.ABFAUFLFD = P.VKPAUFLFD AND X.ABFAUFPOS = P.VKPAUFPOS AND X.ABFAFOLGE = '000' AND MKFTP = '0000') ";
                  
            Connect2Proxy(or1);
        }
        public void INTMKRF06(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "INSERT INTO ICC_MKRF (ABAID,JP05,JP50,JP06,JP07,ABKKDAUFTNR, ABPART, ABPVAR, ABPFARBE, JW, ABFMANDANT, ABFAUFKRS, ABFAUFLFD, ABFAUFPOS, MKFTP, ABFBASMGE,ABFME,ABFAFOLGE, ABFPLANKZ, ABFKSTKRS, ABFKST, ABFAGANG, ABFMTYP, ABFMNRKRS, ABFMLFDNR, ABFMPOS,ABFAMASCHZT, ABFSOLLMG, ABFSOLLME, ABFFIX, ABFSTATUS, ABFSOLLSTART, ABFSOLLDAT, ABFBNRKRS, ABFBLFDNR, ABFBPOS, ABFIMNRKRS, ABFIMLFDNR, ABFIMPOS, ABFIMG, ABFISTARTDAT, ABFISTARTZT, ABFIENDDAT, ABFIENDZT, SPCONFIRM, MKFPLDATV, MKFPLTIME, MKFSCHICHTV, ABFMASCHZE, MKFSORTFD, MKFLFDNR, MKFERLKZ, MKFERLDAT, MKFSME, MKFSMG1, MKFSMG2, MKFSMG3, MKFSMG4, MKFSMG5, MKFSMG6, MKFSMG7, MKFSMG8, PSTARTTIME, PENDTIME, ABFMASCHZT)"
            + " SELECT SEQ_ICC_ITX.NEXTVAL AS ABAID,0,0, ABPPOSTYP, ABPAUFART, ABKKDAUFTNR,ABPART,ABPVAR,ABPFARBE,' ' AS JW,ABFMANDANT,ABFAUFKRS,ABFAUFLFD,ABFAUFPOS,'0000' AS MKFTP,ABFBASMGE,ABFME,ABFAFOLGE,ABFPLANKZ,ABFKSTKRS,ABFKST,ABFAGANG, ABFMTYP,ABFMNRKRS,ABFMLFDNR,ABFMPOS,ABFAMASCHZT,ABFSOLLMG,ABFSOLLME,ABFFIX,ABFSTATUS,ABFSOLLSTART,ABFSOLLDAT,NVL(MKFMNRKRS,' ') AS ABFBNRKRS,NVL(MKFMLFDNR,'0000') AS ABFBLFDNR,NVL(MKFMPOS,'00') AS ABFBPOS,ABFIMNRKRS,ABFIMLFDNR,ABFIMPOS,ABFIMG,ABFISTARTDAT,ABFISTARTZT,ABFIENDDAT,ABFIENDZT,' ' AS SPCONFIRM,NVL(MKFPLDATV,0) AS MKFPLDATV,0 as MKFPLTIME,MKFSCHICHTV,ABFMASCHZE,' ' AS MKFSORTFD,MKFLFDNR, NVL(MKFERLKZ,' '),ABFIENDDAT AS MKFERLDAT,MKFSME,MKFSMG1,MKFSMG2,MKFSMG3,MKFSMG4,MKFSMG5,MKFSMG6,MKFSMG7,MKFSMG8,0 AS PSTARTTIME,0 AS PENDTIME,ABFMASCHZT FROM ABFOLGE F JOIN ABPOS P ON ABFSTATUS =' 'AND ABFAGANG=:ABFAGANG: AND ABFMANDANT=ABPMANDANT AND ABFAUFKRS=ABPAUFKRS AND ABFAUFLFD=ABPAUFLFD AND ABFAUFPOS=ABPAUFPOS JOIN ABKOPF ON ABKMANDANT=ABPMANDANT AND ABKAUFKRS=ABPAUFKRS AND ABKAUFLFD=ABPAUFLFD LEFT JOIN MKRF S ON MKFMANDANT=ABFMANDANT AND ABFAUFKRS=MKFAUFKRS AND ABFAUFLFD=MKFAUFLFD AND ABFAUFPOS=MKFAUFPOS AND ABFAFOLGE=MKFAFOLGE "
            + " WHERE ABFMANDANT=:ABFMANDANT: AND ABFKSTKRS=:ABFKSTKRS: AND ABFKST=:ABFKST: and ABFFIX='N' AND NOT EXISTS ( SELECT 1 FROM ICC_MKRF X WHERE X.ABFMANDANT=F.ABFMANDANT AND X.ABFAUFKRS=F.ABFAUFKRS AND X.ABFAUFLFD=F.ABFAUFLFD AND X.ABFAUFPOS=F.ABFAUFPOS AND X.ABFAFOLGE=F.ABFAFOLGE AND MKFTP='0000')";
            Connect2Proxy(or1);
        }
        public override string BATCHINSERT(DataRow dwData)
        {
            string value = "";
            switch (app.company)
            { 
                default:
                case "YGR":
                case "TST":
                    value = "INTO ICC_MKRF ( ABAID,MACHINEID,ABKKDAUFTNR,ABPART,ABPVAR,ABPFARBE,JW,ABFMANDANT,ABFAUFKRS,ABFAUFLFD,ABFAUFPOS,MKFTP,ABFBASMGE,ABFME,ABFAFOLGE,ABFPLANKZ,ABFKSTKRS,ABFKST,ABFAGANG,ABFMTYP,ABFMNRKRS,ABFMLFDNR,ABFMPOS,ABFAMASCHZT,ABFSOLLMG,ABFSOLLME,ABFFIX,ABFSTATUS,ABFSOLLSTART,ABFSOLLDAT,ABFBNRKRS,ABFBLFDNR,ABFBPOS,ABFIMNRKRS,ABFIMLFDNR,ABFIMPOS,ABFIMG,ABFISTARTDAT,ABFISTARTZT,ABFIENDDAT,ABFIENDZT,SPCONFIRM,MKFPLDATV,MKFPLTIME,MKFSCHICHTV,ABFMASCHZE,MKFSORTFD,MKFLFDNR,MKFERLKZ,MKFERLDAT,MKFSME,MKFSMG1,MKFSMG2,MKFSMG3,MKFSMG4,MKFSMG5,MKFSMG6,MKFSMG7,MKFSMG8,PSTARTTIME,PENDTIME,ABFMASCHZT,JP01,JP02,JP03,JP04,JP05,JP06,JP07,JP08,JP09,JP10,JP11,JP12,JP13,JP14,JP15,JP16,JP17,JP18,JP19,JP20,JP21,JP22,JP23,JP24,JP25,JP26,JP27,JP28,JP29,JP30,JP31,JP32,JP33,JP34,JP35,JP36,JP37,JP38,JP39,JP41,JP42,JP43,JP44,JP45,JP46,JP47,JP48,JP49,JP50,ENDATE,ENDTIME,JOBTYPE,CR,CG,CB,RGB,CGROUP,ABPDESS,ABPCOLORIT,ABPBESCHICH,ABPGROE,ABPWAKZ,BLOCKEDID,MATREADYDATE,MATREADYTIME,MATBLOCKID,TPAUTO,POSTYP,ABPTYPE,SFILETME,EFILETME)"
                   + " VALUES (:ABAID:,:MACHINEID:,:ABKKDAUFTNR:,:ABPART:,:ABPVAR:,:ABPFARBE:,:JW:,:ABFMANDANT:,:ABFAUFKRS:,:ABFAUFLFD:,:ABFAUFPOS:,:MKFTP:,:ABFBASMGE:,:ABFME:,:ABFAFOLGE:,:ABFPLANKZ:,:ABFKSTKRS:,:ABFKST:,:ABFAGANG:,:ABFMTYP:,:ABFMNRKRS:,:ABFMLFDNR:,:ABFMPOS:,:ABFAMASCHZT:,:ABFSOLLMG:,:ABFSOLLME:,:ABFFIX:,:ABFSTATUS:,:ABFSOLLSTART:,:ABFSOLLDAT:,:ABFBNRKRS:,:ABFBLFDNR:,:ABFBPOS:,:ABFIMNRKRS:,:ABFIMLFDNR:,:ABFIMPOS:,:ABFIMG:,:ABFISTARTDAT:,:ABFISTARTZT:,:ABFIENDDAT:,:ABFIENDZT:,:SPCONFIRM:,:MKFPLDATV:,:MKFPLTIME:,:MKFSCHICHTV:,:ABFMASCHZE:,:MKFSORTFD:,:MKFLFDNR:,:MKFERLKZ:,:MKFERLDAT:,:MKFSME:,:MKFSMG1:,:MKFSMG2:,:MKFSMG3:,:MKFSMG4:,:MKFSMG5:,:MKFSMG6:,:MKFSMG7:,:MKFSMG8:,:PSTARTTIME:,:PENDTIME:,:ABFMASCHZT:,:JP01:,:JP02:,:JP03:,:JP04:,:JP05:,:JP06:,:JP07:,:JP08:,:JP09:,:JP10:,:JP11:,:JP12:,:JP13:,:JP14:,:JP15:,:JP16:,:JP17:,:JP18:,:JP19:,:JP20:,:JP21:,:JP22:,:JP23:,:JP24:,:JP25:,:JP26:,:JP27:,:JP28:,:JP29:,:JP30:,:JP31:,:JP32:,:JP33:,:JP34:,:JP35:,:JP36:,:JP37:,:JP38:,:JP39:,:JP41:,:JP42:,:JP43:,:JP44:,:JP45:,:JP46:,:JP47:,:JP48:,:JP49:,:JP50:,:ENDATE:,:ENDTIME:,:JOBTYPE:,:CR:,:CG:,:CB:,:RGB:,:CGROUP:,:ABPDESS:,:ABPCOLORIT:,:ABPBESCHICH:,:ABPGROE:,:ABPWAKZ:,:BLOCKEDID:,:MATREADYDATE:,:MATREADYTIME:,:MATBLOCKID:,:TPAUTO:,:POSTYP:,:ABPTYPE:,:SFILETME:,:EFILETME:)";
                    value = INTEXDBC.InjectData(value, dwData);
                    break;
            }
            return value;
        }
        public DataSet QueryICC_MKRF(DataRow dwData, int option = 1, string rownum = "999999999")
        { 
            switch (option)
            {
                case 0: SResult = QTMKRF00(dwData);  break; 
                case 1: SResult = QTMKRF01(dwData); break; 
                case 2: SResult = QTMKRF02(dwData); break; 
                case 3: SResult = QTMKRF03(dwData);  break;
                case 4: SResult = QTMKRF04(dwData); break; 
                case 5: SResult = QTMKRF05(dwData); break; 
                case 6: SResult = QTMKRF06(dwData); break; 
                case 7: SResult = QTMKRF07(dwData); break; 
                case 8: SResult = QTMKRF08(dwData); break; 
                case 9: SResult = QTMKRF09(dwData); break; 
                default:
                    break;
            }
          
            return SResult;
        }
        public DataSet QTMKRF00(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand(); 

            or1.CommandText = "SELECT * FROM ICC_MKRF WHERE rownum<2";  
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF01(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand(); 
            or1.CommandText = "SELECT * FROM ICC_MKRF WHERE ABAID=:ABAID:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF02(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT NVL(Y.JWS,'J') AS JWS,NVL(Y.GUSAGE,0) AS GUSAGE ,NVL(Y.CR,'108') AS CR,NVL(Y.CG,'108') AS CG,NVL(Y.CB,'108') AS CB,NVL(Y.RGB,'0') AS RGB,NVL(Y.CGROUP,'1') AS CGROUP ,M.*,P.* FROM ICC_MKRF M "
                            + " LEFT JOIN ICC_JWYARN Y ON ABPART=Y.GART AND ABPVAR=Y.GVAR AND ABPFARBE=GFARBE "
                            + " LEFT JOIN ICC_ABAX ON ABAAUFKRS=ABFAUFKRS AND ABAAUFLFD=ABFAUFLFD AND ABAAUFPOS=ABFAUFPOS "
                            + " LEFT JOIN ICC_PVKPOS P ON RTRIM(EXART)=VKPAUFKRS||'-'||SUBSTR(VKPAUFLFD,3,4)||'-'||VKPAUFPOS "
                            + " WHERE ABFMANDANT=:ABFMANDANT: AND ABFKSTKRS=:ABFKSTKRS: AND ABFKST=:ABFKST: AND ABFAGANG=:ABFAGANG:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF03(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();

            or1.CommandText = "SELECT DISTINCT NVL(Y.CR,'108') AS CR,NVL(Y.CG,'108') AS CG,NVL(Y.CB,'108') AS CB,NVL(Y.RGB,'0') AS RGB,NVL(Y.CGROUP,'1') AS CGROUP,M.*,VKPLIEFTERM,VKPQTY FROM ICC_MKRF M"
                  + " LEFT JOIN ICC_JWYARN Y ON ABPART=Y.GART AND ABPVAR=Y.GVAR AND ABPFARBE=GFARBE "
                  + " LEFT JOIN ICC_ABAX ON ABAAUFKRS=ABFAUFKRS AND ABAAUFLFD=ABFAUFLFD AND ABAAUFPOS=ABFAUFPOS "
                  + " LEFT JOIN ICC_PVKPOS P ON RTRIM(EXART)=VKPAUFKRS||'-'||SUBSTR(VKPAUFLFD,3,4)||'-'||VKPAUFPOS"
                  +" WHERE  (ABFSTATUS=' ' OR ABFSTATUS='R') AND ABFMANDANT=:ABFMANDANT: AND ABFKSTKRS=:ABFKSTKRS: AND ABFKST=:ABFKST: AND ABFAGANG=:ABFAGANG: "
                  +dwData["ABAID"].ToString()
                  + " ORDER BY MACHINEID,MKFPLDATV,MKFPLTIME";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName =  TableName;
            return SResult;
        }
        public DataSet QTMKRF04(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand(); 
            or1.CommandText = "SELECT M.*, 108 AS CR, 108 AS CG,108 AS CB,255 AS RGB,1 AS CGROUP" 
                +" FROM ICC_MKRF M WHERE JP49>0"; 
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF05(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT M.* FROM ICC_MKRF M "
                  + " WHERE ABFMANDANT=:ABFMANDANT: AND ABFAUFKRS=:ABFAUFKRS: AND ABFAUFLFD=:ABFAUFLFD:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF06(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT NVL(Y.CR,'108') AS CR,NVL(Y.CG,'108') AS CG,NVL(Y.CB,'108') AS CB,NVL(Y.RGB,'0') AS RGB,NVL(Y.CGROUP,'1') AS CGROUP,M.* FROM ICC_MKRF M LEFT JOIN ICC_JWYARN Y ON ABPART=Y.GART AND ABPVAR=Y.GVAR AND ABPFARBE=GFARBE "
               + " WHERE ABFKST='9999' AND ABFMANDANT=:ABFMANDANT: AND ABFAUFKRS=:ABFAUFKRS: AND ABFAUFLFD=:ABFAUFLFD: AND ABFAUFPOS=:ABFAUFPOS:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF07(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT NVL(Y.CR,'108') AS CR,NVL(Y.CG,'108') AS CG,NVL(Y.CB,'108') AS CB,NVL(Y.RGB,'0') AS RGB,NVL(Y.CGROUP,'1') AS CGROUP,M.* "
                            + " FROM ICC_MKRF M LEFT JOIN ICC_JWYARN Y ON ABPART=Y.GART AND ABPVAR=Y.GVAR AND ABPFARBE=GFARBE "
                            + " JOIN ICC_QUERYTB X ON m.ABFAUFKRS=X.ABPAUFKRS AND M.ABFAUFLFD =X.ABPAUFLFD AND X.ABPAUFPOS=M.ABFAUFPOS "
                            + " WHERE M.ABFKST='9999' AND RTRIM(X.EXART)=:EXART";
            or1.Parameters.Add("EXART", OracleType.NVarChar).Value = dwData["EXART"].ToString().Trim(); ;
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF08(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();

            or1.CommandText = "SELECT DISTINCT M.* FROM ICC_MKRF M JOIN ICC_ABAX x ON ABFAUFKRS=ABAVKAUFKRS AND ABFAUFLFD=ABAVKAUFLFD AND ABFAUFPOS=ABAVKAUFPOS "
                          + " WHERE UNITNUM>1  AND ABFMANDANT=:ABFMANDANT: AND ABFKSTKRS=:ABFKSTKRS: AND ABFKST=:ABFKST: AND MKFERLKZ=:MKFERLKZ:"
                          +dwData["ABFAUFLFD"].ToString()
                          + " ORDER BY ABFAUFKRS,ABFAUFLFD,ABFAUFPOS,MKFTP";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
      
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF09(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT M.* FROM ICC_MKRF M "
                 + " WHERE ABFMANDANT=:ABFMANDANT: AND ABFAUFKRS=:ABFAUFKRS: AND ABFAUFLFD=:ABFAUFLFD: AND ABFAUFPOS=:ABFAUFPOS: AND ABFAFOLGE=:ABFAFOLGE:"
                 + " ORDER BY MKFTP";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF10(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT 'J' AS JWS,0 AS GUSAGE,'108' AS CR,'108' AS CG,'108' AS CB,'108' AS RGB,'1' AS CGROUP ,M.*,P.* FROM ICC_MKRF M "
                             + " LEFT JOIN ICC_PVKPOS P ON  RTRIM(RTRIM(ABPART)||'-'||SUBSTR(ABPFARBE,1,3))=RTRIM(VKPART)||'-'||SUBSTR(ABPFARBE,1,3)"
                            + " WHERE ROWNUM<100 AND ABFMANDANT=:ABFMANDANT: AND ABFAUFKRS=:ABFAUFKRS: AND ABFKSTKRS=:ABFKSTKRS: AND ABFKST=:ABFKST:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF11(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT NVL(Y.CR,'108') AS CR,NVL(Y.CG,'108') AS CG,NVL(Y.CB,'108') AS CB,NVL(Y.RGB,'0') AS RGB,NVL(Y.CGROUP,'1') AS CGROUP,M.* FROM ICC_MKRF M"
                   + " LEFT JOIN ICC_PVKPOS P ON  RTRIM(RTRIM(ABPART)||'-'||SUBSTR(ABPFARBE,1,3))=RTRIM(VKPART)||'-'||SUBSTR(ABPFARBE,1,3)"
                  + "  WHERE  (ABFSTATUS=' ' OR ABFSTATUS='R')AND ABFMANDANT=:ABFMANDANT: AND ABFKSTKRS=:ABFKSTKRS: AND ABFKST=:ABFKST: ORDER BY MACHINEID,MKFPLDATV,MKFPLTIME";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF12(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT M.*, 108 AS CR, 108 AS CG,108 AS CB,255 AS RGB,1 AS CGROUP FROM ICC_MKRF M WHERE ABFMANDANT=:ABFMANDANT: "
                + dwData["MACHINEID"] 
                +dwData["ABAID"];
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF13(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT M.* FROM ICC_MKRF M " 
                            + " WHERE   ABFKSTKRS=:ABFKSTKRS: AND ABFKST=:ABFKST: AND ABFMTYP=:ABFMTYP: AND JOBTYPE=:JOBTYPE:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF14(DataRow dwData)
        { 
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT M.* FROM ICC_MKRF M "
                            + " WHERE   ABFBNRKRS=:ABFBNRKRS: AND ABFBLFDNR=:ABFBLFDNR: AND ABFBPOS=:ABFBPOS: AND JOBTYPE=:JOBTYPE: AND MKFPLDATV>=:MKFPLDATV:"
                            + " ORDER BY SFILETME";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF15(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT M.* FROM ICC_MKRF M "
                            + " WHERE   ABFBNRKRS=:ABFBNRKRS: AND ABFBLFDNR=:ABFBLFDNR: AND ABFBPOS=:ABFBPOS: AND JOBTYPE=:JOBTYPE: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QTMKRF16(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT M.* FROM ICC_MKRF M "
                 + " WHERE ABFMANDANT=:ABFMANDANT: AND ABFAUFKRS=:ABFAUFKRS: AND ABFAUFLFD=:ABFAUFLFD: AND ABFAUFPOS=:ABFAUFPOS:"
                 + " ORDER BY MKFTP";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }

        public void UpdateICC_MKRF(DataRow dwData, int option = 1)
        {
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "UPDATE ICC_MKRF SET ABAID=:ABAID:,MACHINEID=:MACHINEID:,ABKKDAUFTNR=:ABKKDAUFTNR:,ABPART=:ABPART:,ABPVAR=:ABPVAR:,ABPFARBE=:ABPFARBE:,JW=:JW:,ABFMANDANT=:ABFMANDANT:,ABFAUFKRS=:ABFAUFKRS:,ABFAUFLFD=:ABFAUFLFD:,ABFAUFPOS=:ABFAUFPOS:,MKFTP=:MKFTP:,ABFBASMGE=:ABFBASMGE:,ABFME=:ABFME:,ABFAFOLGE=:ABFAFOLGE:,ABFPLANKZ=:ABFPLANKZ:,ABFKSTKRS=:ABFKSTKRS:,ABFKST=:ABFKST:,ABFAGANG=:ABFAGANG:,ABFMTYP=:ABFMTYP:,ABFMNRKRS=:ABFMNRKRS:,ABFMLFDNR=:ABFMLFDNR:,ABFMPOS=:ABFMPOS:,ABFAMASCHZT=:ABFAMASCHZT:,ABFSOLLMG=:ABFSOLLMG:,ABFSOLLME=:ABFSOLLME:,ABFFIX=:ABFFIX:,ABFSTATUS=:ABFSTATUS:,ABFSOLLSTART=:ABFSOLLSTART:,ABFSOLLDAT=:ABFSOLLDAT:,ABFBNRKRS=:ABFBNRKRS:,ABFBLFDNR=:ABFBLFDNR:,ABFBPOS=:ABFBPOS:,ABFIMNRKRS=:ABFIMNRKRS:,ABFIMLFDNR=:ABFIMLFDNR:,ABFIMPOS=:ABFIMPOS:,ABFIMG=:ABFIMG:,ABFISTARTDAT=:ABFISTARTDAT:,ABFISTARTZT=:ABFISTARTZT:,ABFIENDDAT=:ABFIENDDAT:,ABFIENDZT=:ABFIENDZT:,SPCONFIRM=:SPCONFIRM:,MKFPLDATV=:MKFPLDATV:,MKFPLTIME=:MKFPLTIME:,MKFSCHICHTV=:MKFSCHICHTV:,ABFMASCHZE=:ABFMASCHZE:,MKFSORTFD=:MKFSORTFD:,MKFLFDNR=:MKFLFDNR:,MKFERLKZ=:MKFERLKZ:,MKFERLDAT=:MKFERLDAT:,MKFSME=:MKFSME:,MKFSMG1=:MKFSMG1:,MKFSMG2=:MKFSMG2:,MKFSMG3=:MKFSMG3:,MKFSMG4=:MKFSMG4:,MKFSMG5=:MKFSMG5:,MKFSMG6=:MKFSMG6:,MKFSMG7=:MKFSMG7:,MKFSMG8=:MKFSMG8:,PSTARTTIME=:PSTARTTIME:,PENDTIME=:PENDTIME:,ABFMASCHZT=:ABFMASCHZT:,JP01=:JP01:,JP02=:JP02:,JP03=:JP03:,JP04=:JP04:,JP05=:JP05:,JP06=:JP06:,JP07=:JP07:,JP08=:JP08:,JP09=:JP09:,JP10=:JP10:,JP11=:JP11:,JP12=:JP12:,JP13=:JP13:,JP14=:JP14:,JP15=:JP15:,JP16=:JP16:,JP17=:JP17:,JP18=:JP18:,JP19=:JP19:,JP20=:JP20:,JP21=:JP21:,JP22=:JP22:,JP23=:JP23:,JP24=:JP24:,JP25=:JP25:,JP26=:JP26:,JP27=:JP27:,JP28=:JP28:,JP29=:JP29:,JP30=:JP30:,JP31=:JP31:,JP32=:JP32:,JP33=:JP33:,JP34=:JP34:,JP35=:JP35:,JP36=:JP36:,JP37=:JP37:,JP38=:JP38:,JP39=:JP39:,JP41=:JP41:,JP42=:JP42:,JP43=:JP43:,JP44=:JP44:,JP45=:JP45:,JP46=:JP46:,JP47=:JP47:,JP48=:JP48:,JP49=:JP49:,JP50=:JP50:,ENDATE=:ENDATE:,ENDTIME=:ENDTIME:,JOBTYPE=:JOBTYPE:,CR=:CR:,CG=:CG:,CB=:CB:,RGB=:RGB:,CGROUP=:CGROUP:,ABPDESS=:ABPDESS:,ABPCOLORIT=:ABPCOLORIT:,ABPBESCHICH=:ABPBESCHICH:,ABPGROE=:ABPGROE:,ABPWAKZ=:ABPWAKZ:,BLOCKEDID=:BLOCKEDID:,MATREADYDATE=:MATREADYDATE:,MATREADYTIME=:MATREADYTIME:,MATBLOCKID=:MATBLOCKID:,TPAUTO=:TPAUTO:,SFILETME=:SFILETME:,EFILETME=:EFILETME:"
                        + " WHERE ABAID=:ABAID:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
                    break;
                case 2:
                    or1.CommandText = "UPDATE ICC_MKRF SET JW='W ' WHERE SPCONFIRM=' ' AND EXISTS (SELECT 1 FROM WASTGA B WHERE B.WAGGART=ABPART AND WAGGVAR=ABPVAR AND WAGGFARBE=ABPFARBE)";
                    break;
                case 3:
                    or1.CommandText = "UPDATE ICC_MKRF SET JW='J ' WHERE SPCONFIRM=' ' AND EXISTS (SELECT 1 FROM BASTGA B WHERE B.BAGGART=ABPART AND BAGGVAR=ABPVAR AND BAGGFARBE=ABPFARBE)";
                    break;
                case 4:
                    or1.CommandText = "UPDATE ICC_MKRF SET MKFSMG1=(CASE WHEN ABFSOLLME=1 THEN ABFSOLLMG*0.1 ELSE 0 END), MKFSMG2=(CASE WHEN ABFSOLLME=2 THEN ABFSOLLMG*0.1 ELSE 0 END), MKFSMG3=(CASE WHEN ABFSOLLME=3 THEN ABFSOLLMG*0.1 ELSE 0 END), MKFSMG4=(CASE WHEN ABFSOLLME=4 THEN ABFSOLLMG*0.1 ELSE 0 END), MKFSMG5=(CASE WHEN ABFSOLLME=5 THEN ABFSOLLMG*0.1 ELSE 0 END), MKFSMG6=(CASE WHEN ABFSOLLME=6 THEN ABFSOLLMG*0.1 ELSE 0 END), MKFSMG7=(CASE WHEN ABFSOLLME=7 THEN ABFSOLLMG*0.1 ELSE 0 END), MKFSMG8=(CASE WHEN ABFSOLLME=8 THEN ABFSOLLMG*0.1 ELSE 0 END), MKFSME=ABFSOLLME WHERE SPCONFIRM=' ' AND JP50=0 AND MKFTP='0000'";
                    break;
                case 5:
                    or1.CommandText = "UPDATE ICC_MKRF SET (JP01,JP02,JP03,JP04,JP05)=(SELECT DISTINCT GSRECHNR*0.01*0.01,GSMAT,GSPROGRP,GSARTGRP,(MKFSMG1+MKFSMG2+MKFSMG3+MKFSMG4+MKFSMG5+MKFSMG6+MKFSMG7+MKFSMG8)*0.01 FROM GSDAT WHERE ABPART=GSART AND ABPVAR=GSVAR) WHERE SPCONFIRM=' ' AND JP50=0 AND EXISTS (SELECT 1 FROM GSDAT WHERE ABPART=GSART AND ABPVAR=GSVAR)";
                    break;
                case 6:
                    or1.CommandText = "UPDATE ICC_MKRF SET (ABFMASCHZE,ABFMASCHZT,ABFBASMGE)=(SELECT DISTINCT 'ST',2400,NVL(MDAILY,100)*1000 FROM ICC_SPINSPEED WHERE JP01=YN) WHERE SPCONFIRM=' ' AND EXISTS (SELECT 1 FROM ICC_SPINSPEED WHERE JP01=YN)";
                    break;
                case 7:
                    //or1.CommandText = "UPDATE ICC_MKRF SET MACHINEID=(CASE WHEN RTRIM(JP06)='XS' THEN 'm99_9999_30' WHEN RTRIM(JP06)='HM' THEN 'm99_9999_20' WHEN RTRIM(JP06)='BX' THEN 'm99_9999_40' WHEN RTRIM(JP06)='MU' THEN 'm99_9999_10' ELSE 'm99_9999_10' END),JP07=(CASE WHEN RTRIM(JP06)='XS' THEN 'XSJobBar' WHEN RTRIM(JP06)='HM' THEN 'HMJobBar' WHEN RTRIM(JP06)='BX' THEN 'BXJobBar' WHEN RTRIM(JP06)='MU' THEN 'MUJobBar' ELSE 'JobBar' END) WHERE ABFKST='9999' AND RTRIM(MACHINEID)=''";
                    break;
                case 8:
                    or1.CommandText = "UPDATE ICC_MKRF SET (JP11,JP12,JP13,JP14,JP15,JP16,JP17,JP18)=(SELECT ROUND(SUM(GAKG1)*0.01,0), ROUND(SUM(GAKG2)*0.01,0), ROUND(SUM(GAKG3)*0.01,0), ROUND(SUM(GAKG4)*0.01,0), ROUND(SUM(GAKG5)*0.01,0), ROUND(SUM(GAKG6)*0.01,0), ROUND(SUM(GAKG7)*0.01,0),COUNT(*) FROM GAAUF WHERE GAAUFKRS=ABFAUFKRS AND GAAUFLFD=ABFAUFLFD AND GAAUFPOS=ABFAUFPOS AND GASA=:GASA GROUP BY GAAUFKRS,GAAUFLFD,GAAUFPOS) WHERE ABFKSTKRS='99' AND ABFKST='9999' AND MKFERLKZ=' ' AND EXISTS (SELECT 1 FROM GAAUF WHERE GAAUFKRS=ABFAUFKRS AND GAAUFLFD=ABFAUFLFD AND GAAUFPOS=ABFAUFPOS AND GASA=:GASA )";
                    or1.Parameters.Add("GASA", OracleType.NVarChar).Value = dwData["C3"].ToString();
                    break;
                case 9:
                    or1.CommandText = "UPDATE ICC_MKRF SET (JP05,JP19,JP20,MKFPLDATV,MKFPLTIME,ENDATE,ENDTIME, ABFIENDDAT,ABFIENDZT,MKFERLKZ)=(SELECT ROUND(ABPSOLLMENGE5*0.01,0), ABPEALFM*0.01, ROUND(ABPEAKG*0.01,0),ABPSTARTDAT,0,ABPENDDAT,0,ABPERLDAT,0,ABPERLKZ FROM ABPOS WHERE ABPAUFKRS=ABFAUFKRS AND ABPAUFLFD=ABFAUFLFD AND ABPAUFPOS=ABFAUFPOS) WHERE ABFKSTKRS='99' AND ABFKST='9999' AND MKFERLKZ=' ' AND EXISTS (SELECT 1 FROM ABPOS WHERE ABPAUFKRS=ABFAUFKRS AND ABPAUFLFD=ABFAUFLFD AND ABPAUFPOS=ABFAUFPOS )";
                    break;
                case 10:
                    or1.CommandText = "UPDATE ICC_MKRF SET (JP21,JP22)=(SELECT ROUND(SUM(ABARESMG)*0.001,0),COUNT(*) FROM ABAUFM WHERE ABAAUFKRS=ABFAUFKRS AND ABAAUFLFD=ABFAUFLFD AND ABAAUFPOS=ABFAUFPOS AND ABAVKAUFLFD<>'000000') WHERE ABFKSTKRS='99' AND ABFKST='9999' AND MKFERLKZ=' ' AND EXISTS (SELECT 1 FROM ABAUFM WHERE ABAAUFKRS=ABFAUFKRS AND ABAAUFLFD=ABFAUFLFD AND ABAAUFPOS=ABFAUFPOS AND ABAVKAUFLFD<>'000000' )";
                    break;
                case 11:
                    or1.CommandText = "UPDATE ICC_MKRF X SET (ABFISTARTDAT,ABFISTARTZT)=(SELECT MIN(ABFISTARTDAT),0 FROM ABFOLGE F WHERE F.ABFAUFKRS=X.ABFAUFKRS AND F.ABFAUFLFD=X.ABFAUFLFD AND F.ABFAUFPOS=X.ABFAUFPOS) WHERE ABFKSTKRS='99' AND ABFKST='9999' AND MKFERLKZ=' ' AND EXISTS (SELECT 1 FROM ABFOLGE F WHERE F.ABFAUFKRS=X.ABFAUFKRS AND F.ABFAUFLFD=X.ABFAUFLFD AND F.ABFAUFPOS=X.ABFAUFPOS )";
                    break;
                case 12:
                    or1.CommandText = "UPDATE ICC_MKRF SET (JP31,JP32,JP33,JP34,JP35,JP36,JP37)=(SELECT ROUND(SUM(BAMTR1)*0.01,0), ROUND(SUM(BAMTR2)*0.01,0), ROUND(SUM(BAMTR3)*0.01,0), ROUND(SUM(BAMTR4)*0.01,0), ROUND(SUM(BAMTR5)*0.01,0), ROUND(SUM(BAMTR6)*0.01,0), ROUND(SUM(BAMTR7)*0.01,0) FROM BAAUF WHERE BAAUFKRS=ABFAUFKRS AND BAAUFLFD=ABFAUFLFD AND BAAUFPOS=ABFAUFPOS AND BASA=:BASA GROUP BY BAAUFKRS,BAAUFLFD,BAAUFPOS) WHERE ABFKSTKRS='99' AND ABFKST='9999' AND MKFERLKZ=' ' AND EXISTS (SELECT 1 FROM BAAUF WHERE BAAUFKRS=ABFAUFKRS AND BAAUFLFD=ABFAUFLFD AND BAAUFPOS=ABFAUFPOS AND BASA=:BASA )";
                    or1.Parameters.Add("BASA", OracleType.NVarChar).Value = dwData["C3"].ToString();
                    break;
                case 13:
                    or1.CommandText = "UPDATE ICC_MKRF SET (JP38,JP39,JP41)=(SELECT ROUND(SUM(WDBEDARF)*0.01,0), ROUND(SUM(WDZUGET)*0.01,0), ROUND(SUM(WDRESERV)*0.01,0) FROM WDECK WHERE WDAUFKRS=ABFAUFKRS AND WDAUFLFD=ABFAUFLFD AND WDAUFPOS=ABFAUFPOS AND WDTYP=:WDTYP GROUP BY WDAUFKRS,WDAUFLFD,WDAUFPOS) WHERE ABFKSTKRS='99' AND ABFKST='9999' AND MKFERLKZ=' ' AND EXISTS (SELECT 1 FROM WDECK WHERE WDTYP=:WDTYP AND WDAUFKRS=ABFAUFKRS AND WDAUFLFD=ABFAUFLFD AND WDAUFPOS=ABFAUFPOS )";
                    or1.Parameters.Add("WDTYP", OracleType.NVarChar).Value = dwData["WDTYP"].ToString();
                    break;
                case 14:
                    or1.CommandText = "UPDATE ICC_MKRF M SET JP08=(SELECT MAX(UNITNUM) FROM ICC_ABAX WHERE ABFAUFKRS=ABAVKAUFKRS AND ABFAUFLFD=ABAVKAUFLFD AND ABFAUFPOS=ABAVKAUFPOS) WHERE JP08=0 AND EXISTS (SELECT 1 FROM ICC_ABAX WHERE ABFAUFKRS=ABAVKAUFKRS AND ABFAUFLFD=ABAVKAUFLFD AND ABFAUFPOS=ABAVKAUFPOS)";
                    break;
            }
            Connect2Proxy(or1);
        }
        public void UKRFJP(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE   ICC_MKRF SET JP01=:JP01:,JP02=:JP02:,JP03=:JP03:,JP04=:JP04: ,JP06=:JP06:   WHERE ABAID=:ABAID:"; ;
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void DeleteICC_MKRF(DataRow dwData, int option = 1)
        {
           
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    DMKRF01(dwData);
                    break;
                case 2:
                    or1.CommandText = "DELETE FROM ICC_MKRF WHERE MKFERLKZ=:MKFERLKZ:"; ;
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 3:
                    or1.CommandText = "DELETE FROM ICC_MKRF WHERE ABFAUFKRS=:ABFAUFKRS: AND ABFAUFLFD=:ABFAUFLFD: AND ABFAUFPOS=:ABFAUFPOS: AND ABFAFOLGE=:ABFAFOLGE: AND MKFTP<>'0000' "; ;
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DMKRF01(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE FROM ICC_MKRF WHERE ABAID=:ABAID:"; ;
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void DMKRF04(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE FROM ICC_MKRF WHERE ABFBNRKRS=:ABFBNRKRS: AND ABFBLFDNR=:ABFBLFDNR: AND ABFBPOS=:ABFBPOS: AND JOBTYPE=:JOBTYPE:  "; ;
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void DMKRF05(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE FROM ICC_MKRF WHERE SFILETME<:SFILETME: AND JOBTYPE=:JOBTYPE:  "; ;
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        } 
    }
}
